#include <iostream>
using namespace std;
/*
Create a class that contains four member functions, with 0, 1, 2, and 3 int arguments, respectively. 
Create a main( ) that makes an object of your class and calls each of the member functions. 

Now modify the class so it has instead a single member function with all the arguments defaulted. 
Does this change your main( )?
*/
//一般方案：
class C1
{
public:
    void function0()
    {
        cout << "the function with 0 argument is called." << endl;
    }

    void function1(int a)
    {
        cout << "the function with 1 argument is called." << endl;
    }

    void function2(int a, int b)
    {
        cout << "the function with 2 arguments is called." << endl;
    }

    void function3(int a, int b, int c)
    {
        cout << "the function with 3 arguments is called." << endl;
    }

    C1()
    {
        function0();
        function1(1);
        function2(1, 2);
        function3(1, 2, 3);
    }
};

//改进方案：
class C2
{
public:
    void function(int = 1, int = 2, int = 3)
    {
        cout << "the function with default arguments is called." << endl;
    }

    C2()
    {
        function();
    }
};

int main()
{
    C1 c1;
    C2 c2;
    return 0;
}